<template>
  <div>
    <el-card shadow='never'>
      <el-descriptions
        v-if="form.basicData"
        class="margin-top"
        :column="2"
        border
        :labelStyle='style'
        style='width: 100%'
      >
        <el-descriptions-item
          label="项目编号"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.xmbm}}</el-descriptions-item>
        <el-descriptions-item
          label="项目名称"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.name }}</el-descriptions-item>
        <el-descriptions-item
          label="项目简称"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.xmjc }}</el-descriptions-item>
        <el-descriptions-item
          label="药物名称"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.drugName }}</el-descriptions-item>
        <el-descriptions-item
          label="英文名称"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.enName }}</el-descriptions-item>
        <el-descriptions-item
          label="剂型"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.dose }}</el-descriptions-item>
        <el-descriptions-item
          label="阶段"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.phase }}</el-descriptions-item>
        <el-descriptions-item
          label="临床试验批号"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.instructionsId }}</el-descriptions-item>
        <el-descriptions-item
          label="批件号日期"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.instructionsTime }}</el-descriptions-item>
        <el-descriptions-item
          label="适应症"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.indication }}</el-descriptions-item>
        <el-descriptions-item
          label="意向科室"
          v-if="form.basicData.JBXX"
        >{{ form.basicData.JBXX.room }}</el-descriptions-item>
      </el-descriptions>
    </el-card>
  </div>
</template>

<script>
import { mapState } from 'vuex';
export default {
    data() {
        return {
            style: {
                width: '15%'
            },
            form: {}
        };
    },
    computed: {
        // ...mapState(['applyFor'])

        ...mapState({
            flag: (state) => {
                return state.applyFor.listFlag;
            },
            basicJbxx: (state) => {
                return state.applyFor;
            }
        })
    },
    mounted() {
        // // let applyFor =  this.$store.state.applyFor.basicData
        // // let basicData  = applyFor.length?applyFor[0]:{JBXX:''}
        if (this.flag == 'apply') {
            this.form = this.basicJbxx;
        } else if (this.flag == 'tabs') {
            this.form = this.basicJbxx;
        }
    }
};
</script>

<style>
</style>
